Error in {% markdown %} filter in Django Nonrel

Posted by Robert Smith on Stack Overflow See other posts from Stack Overflow or by Robert Smith
Published on 2011-11-14T22:36:39Z Indexed on 2011/11/15 1:52 UTC
Read the original article Hit count: 421

Filed under:
|
|

I'm having trouble using Markdown in Django Nonrel. I followed this instructions (added 'django.contrib.markup' to INSTALLED_APPS, include {% load markup %} in the template and use |markdown filter after installing python-markdown) but I get the following error:

Error in {% markdown %} filter: The Python markdown library isn't installed.

In this line:

/path/to/project/django/contrib/markup/templatetags/markup.py in markdown
    they will be silently ignored.
    """
    try:
        import markdown
    except ImportError:
        if settings.DEBUG:
            raise template.TemplateSyntaxError("Error in {% markdown %} filter: The Python markdown library isn't installed.") ...
        return force_unicode(value)
    else:
        # markdown.version was first added in 1.6b. The only version of markdown
        # to fully support extensions before 1.6b was the shortlived 1.6a.
        if hasattr(markdown, 'version'):
            extensions = [e for e in arg.split(",") if e]

It seems obvious that import markdown is causing the problem but when I run:

$ python manage.py shell
>>> import elementtree
>>> import markdown

everthing works alright.

Running Markdown 2.0.3, Django 1.3.1, Python 2.7.

UPDATE: I thought maybe this was an issue related to permissions, so I changed my project via chmod 777 -R, but it didn't work.

Ideas?

Thanks!

© Stack Overflow or respective owner

Related posts about django

Related posts about markdown